package src
{
	import flash.display.Sprite;
	import flash.display.Stage;
	import flash.events.KeyboardEvent;
	import flash.geom.ColorTransform;
	
	public class KeyboardListener extends Sprite
	{
		private var myParent:Treppy;
		public function KeyboardListener(myParent:Treppy){
			this.myParent = myParent;
			myParent.stage.addEventListener(KeyboardEvent.KEY_DOWN,key1);
		}
		
		private function key1(e:KeyboardEvent):void{
			trace(e.keyCode);
			if (e.ctrlKey && e.altKey){
				var ct:ColorTransform;
				switch(e.keyCode){
					case 49 : 
						ct = new ColorTransform(1,1,1,1,0,100,0,0);
						myParent.border.transform.colorTransform = ct;
						break;
					case 50 : 
						ct = new ColorTransform(1,1,1,1,0,0,100,0);
						myParent.border.transform.colorTransform = ct;
						break;
					case 51 : 
						ct = new ColorTransform(1,1,1,1,100,0,0,0);
						myParent.border.transform.colorTransform = ct;
						break;
					case 48 : 
						ct = new ColorTransform(1,1,1,1,0,0,0,0);
						myParent.border.transform.colorTransform = ct;
						break;	
				}
			}
			
		}
	}
}